package com.winhxd.b2c.common.domain.order.enums;

/**
 * @author wangxiaoshun
 * @date 2019/1/9 11:01
 * @Description 订单操作属性
 */
public enum OrderOperationPropertyEnum {

    /**
     * 创建
     */
    CREATED("CREATED","订单-创建"),
    /**
     * 取消
     */
    CENCEL("CENCEL","订单-取消"),
    /**
     * 已支付
     */
    PAY("PAY","订单-支付"),

    AFTER_SALE_APPLY("AFTER_SALE_APPLY","售后-申请"),

    AFTER_SALE_CANCEL("AFTER_SALE_CANCEL","售后-撤销"),
    /**
     * 已发货
     */
    DELIVERED("DELIVERED","订单-已发货"),
    /**
     * 已收货
     */
    RECEIVE("RECEIVE","订单-用户已收货"),
    /**
     * 自动收货
     */
    AUTO_RECEIVE("AUTO_RECEIVE","订单-自动确认收货"),
    /**
     * 申请退货
     */
    APPLY_RETURN("APPLY_RETURN","售后-申请退货"),
    /**
     * 同意退货
     */
    AGREED_RETURN("AGREED_RETURN","售后-同意退货"),
    /**
     * 申请退款
     */
    APPLY_REFUND("APPLY_REFUND","售后-申请退款"),

    /**
     * 同意退款
     */
    AGREED_REFUND("AGREED_REFUND","售后-同意退款"),

    /**
     * 申请换货
     */
    APPLY_REPLACE("APPLY_REPLACE","售后-申请换货"),

    /**
     * 关闭订单
     */
    CLOSE_ORDER("CLOSE_ORDER","订单-关闭订单"),
    /**
     * 关闭订单
     */
    FINISH_ORDER("FINISH_ORDER","订单-订单完成"),

    /**
     * 同意换货
     */
    AGREED_REPLACE("AGREED_REPLACE","售后-同意换货"),
    /**
     * 手动关闭售后
     */
    HAND_CLOSE_AFTER_SALE("HAND_CLOSE_AFTER_SALE","售后-手动关闭售后"),
    /**
     * 未输入物流信息关闭售后
     */
    HAND_CLOSE_AFTER_SALE_NO_EXPRESS("HAND_CLOSE_AFTER_SALE_NO_EXPRESS","售后-未输入物流信息关闭售后"),
    /**
     * 售后待发货仅退款同意退款
     */
    AFTER_SALE_WAIT_DELIVERING_REFUND_AGREED("AFTER_SALE_WAIT_DELIVERING_REFUND_AGREED","售后-审核-待发货退款-同意退款"),
    /**
     * 售后待发货仅退款拒绝退款
     */
    AFTER_SALE_WAIT_DELIVERING_REFUND_REFUSE("AFTER_SALE_WAIT_DELIVERING_REFUND_REFUSE","售后-审核-待发货退款-拒绝退款"),
    /**
     * 售后待发货仅退款退款中
     */
    AFTER_SALE_WAIT_DELIVERING_REFUND_PROCESS("AFTER_SALE_WAIT_DELIVERING_REFUND_PROCESS","售后-退款-待发货退款-退款中"),
    /**
     * 售后待发货仅退款退款完成
     */
    AFTER_SALE_WAIT_DELIVERING_REFUND_FINISH("AFTER_SALE_WAIT_DELIVERING_REFUND_FINISH","售后-退款-待发货退款-退款完成"),
    /**
     * 售后待发货仅退款退款失败
     */
    AFTER_SALE_WAIT_DELIVERING_REFUND_FAIL("AFTER_SALE_WAIT_DELIVERING_REFUND_FAIL","售后-退款-待发货退款-退款失败"),
    /**
     * 售后待收货换货同意
     */
    AFTER_SALE_WAIT_RECEIVING_EXCHANGE_AGREED("AFTER_SALE_WAIT_RECEIVING_EXCHANGE_AGREED","售后-审核-待收货换货-同意换货"),
    /**
     * 售后待收货换货拒绝
     */
    AFTER_SALE_WAIT_RECEIVING_EXCHANGE_REFUSE("AFTER_SALE_WAIT_RECEIVING_EXCHANGE_REFUSE","售后-审核-待收货换货-拒绝换货"),
    /**
     * 售后待收货换货同意-换货中
     */
    AFTER_SALE_WAIT_RECEIVING_EXCHANGE_PROCESS("AFTER_SALE_WAIT_RECEIVING_EXCHANGE_PROCESS","售后-换货-待收货换货-换货中"),
    /**
     * 售后待收货换货同意-换货完成
     */
    AFTER_SALE_WAIT_RECEIVING_EXCHANGE_FINISH("AFTER_SALE_WAIT_RECEIVING_EXCHANGE_FINISH","售后-换货-待收货换货-换货完成"),

    /**
     * 售后待收货退货同意
     */
    AFTER_SALE_WAIT_RECEIVING_REFUND_AGREED("AFTER_SALE_WAIT_RECEIVING_REFUND_AGREED","售后-审核-待收货退货-同意退货"),
    /**
     * 售后待收货退货拒绝
     */
    AFTER_SALE_WAIT_RECEIVING_REFUND_REFUSE("AFTER_SALE_WAIT_RECEIVING_REFUND_REFUSE","售后-审核-待收货退货-拒绝退货"),
    /**
     * 售后待收货退货同意-退款中
     */
    AFTER_SALE_WAIT_RECEIVING_REFUND_PROCESS("AFTER_SALE_WAIT_RECEIVING_REFUND_PROCESS","售后-退款-待收货退货退款-退款中"),
    /**
     * 售后待收货退货同意-退款完成
     */
    AFTER_SALE_WAIT_RECEIVING_REFUND_FINISH("AFTER_SALE_WAIT_RECEIVING_REFUND_FINISH","售后-退款-待收货退货退款-退款完成"),
    /**
     * 售后待收货退货同意-退款失败
     */
    AFTER_SALE_WAIT_RECEIVING_REFUND_FAIL("AFTER_SALE_WAIT_RECEIVING_REFUND_FAIL","售后-退款-待收货退货退款-退款失败"),

    /**
     * 售后已完成换货同意
     */
    AFTER_SALE_FINISHED_EXCHANGE_AGREED("AFTER_SALE_FINISHED_EXCHANGE_AGREED","售后-审核-订单已完成-同意换货"),
    /**
     * 售后已完成换货拒绝
     */
    AFTER_SALE_FINISHED_EXCHANGE_REFUSE("AFTER_SALE_FINISHED_EXCHANGE_REFUSE","售后-审核-订单已完成-拒绝换货"),
    /**
     * 售后已完成换货同意-换货中
     */
    AFTER_SALE_FINISHED_EXCHANGE_PROCESS("AFTER_SALE_FINISHED_EXCHANGE_PROCESS","售后-换货-订单已完成-换货中"),
    /**
     * 售后已完成换货同意-换货完成
     */
    AFTER_SALE_FINISHED_EXCHANGE_FINISH("AFTER_SALE_FINISHED_EXCHANGE_FINISH","售后-换货-订单已完成-换货完成"),
    /**
     * 售后已完成退款同意
     */
    AFTER_SALE_FINISHED_REFUND_AGREED("AFTER_SALE_FINISHED_REFUND_AGREED","售后-审核-订单已完成-同意退款"),
    /**
     * 售后已完成退款拒绝
     */
    AFTER_SALE_FINISHED_REFUND_REFUSE("AFTER_SALE_FINISHED_REFUND_REFUSE","售后-审核-订单已完成-拒绝退款"),
    /**
     * 售后已完成退款同意-退款中
     */
    AFTER_SALE_FINISHED_REFUND_PROCESS("AFTER_SALE_FINISHED_REFUND_PROCESS","售后-退款-订单已完成-退款中"),
    /**
     * 售后已完成退款同意-退款完成
     */
    AFTER_SALE_FINISHED_REFUND_FINISH("AFTER_SALE_FINISHED_REFUND_FINISH","售后-退款-订单已完成-退款完成"),
    /**
     * 售后已完成退款同意-退款失败
     */
    AFTER_SALE_FINISHED_REFUND_FAIL("AFTER_SALE_FINISHED_REFUND_FAIL","售后-退款-订单已完成-退款失败");



    private String propertyCode;
    private String propertyDes;

    OrderOperationPropertyEnum(String propertyCode, String propertyDes) {
        this.propertyCode = propertyCode;
        this.propertyDes = propertyDes;
    }

    public String getPropertyCode() {
        return propertyCode;
    }

    public void setPropertyCode(String propertyCode) {
        this.propertyCode = propertyCode;
    }

    public String getPropertyDes() {
        return propertyDes;
    }

    public void setPropertyDes(String propertyDes) {
        this.propertyDes = propertyDes;
    }

    public static String getDescByCode(String code) {
        if (null != code && !"".equals(code)) {
            for (OrderOperationPropertyEnum typeEnum : OrderOperationPropertyEnum.values()) {
                if (typeEnum.getPropertyCode() == code) {
                    return typeEnum.getPropertyDes();
                }
            }
        }
        return null;
    }
}
